package com.ssyt.hiringtwo.servies.company;

import java.util.List;

import com.ssyt.hiringtwo.common.DBUtil;
import com.ssyt.hiringtwo.entity.CityEntity;
import com.ssyt.hiringtwo.entity.ProvinceEntity;

public class AreaService {

    /**
     * 查询所有的省
     * 
     * @return
     */
    public List<ProvinceEntity> listProvince() {
        String sql = "SELECT * FROM province";
        return DBUtil.executeQuery(ProvinceEntity.class, sql);
    }

    /**
     * 根据省编码获取所有的城市
     * 
     * @param provinceCode
     * @return
     */
    public List<CityEntity> listCitiesByProvinceCode(String provinceCode) {
        String sql = "SELECT * FROM city WHERE province_code=?";
        return DBUtil.executeQuery(CityEntity.class, sql, provinceCode);
    }
}
